import {defineAsyncComponent} from 'vue'

export const components = new Map<string, any>()

export function registerComponent(name: string, component: ()=>Promise<any>) {
  if (components.get(name)) {
    throw new Error("组件名称已经存在：" + name)
  }
  components.set(name, defineAsyncComponent(component))
}

